<?php get_header(); ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'scrollLeft',
		delay: 5000

	});
	$('#s6').cycle({ 
    
	fx:     'scrollLeft', 
    delay:1000,
	prev:'#link-prev',
    next: '#link-next'
   });
   $('#sections').cycle({ 
    
	fx:     'fade', 
    timeout: 6000 ,
	delay:6500
   });
   $('#pauseBtn').toggle(function() {

                $('#s6').cycle('pause');
                $('#mute').attr({ src: "<?php bloginfo('template_directory'); ?>/images/play.jpg"});

                }, function() {

                $('#s6').cycle('resume', true);
               $('#mute').attr({ src: "<?php bloginfo('template_directory'); ?>/images/pause.jpg"});
        });

});
	
</script>   

<div id="wrapper2" style="margin-top: -1px; background-position: 0px 0px;">
<div id="container">
<?php if (get_option('evid_featured') == 'on') { get_template_part('includes/featured'); } ?>
<span class="current-category">
	<?php single_cat_title(esc_html__('Currently Browsing asdf: ','eVid'), 'display'); ?>
</span>
<?php 
$subcategories = get_categories('&child_of=4&hide_empty');

$cnt1= 0;
?>

<div class="slideshow <? echo is_category()?'category':'' ?>">

<div class="slide">
<?php
foreach ($subcategories as $subcategory) {

$catlink = get_category_link($subcategory->term_id);
$catname = $subcategory->name;
$caticon = "select * from wp_ig_caticons where cat_id='".$subcategory->term_id."'";
$qun = mysql_query($caticon);
$datacat = $wpdb->get_results($caticon);
$count = mysql_num_rows($qun);
if($count >0){
$cnt1++;
}
if($cnt1==5 || $cnt1==9 || $cnt1==13){ ?>
</div><div class="slide"> 
<?php } 
foreach ($datacat as $dct) {
$catpath = 'http://bigvoicesmedia.biz/'.$dct->icon;	
 ?>
	
		<a href="<?php echo $catname; ?>" class="network"><img src="<?php echo $catpath; ?>" width="115" height="110" /></a>	
			<?php } }  ?></div></div>
<?php
	$category = get_the_category();
	$category_id = $category[0]->term_id;

	$photo1 = $wpdb->get_var("SELECT photo1 FROM $wpdb->terms WHERE term_id=" . $category_id);
	$photo2 = $wpdb->get_var("SELECT photo2 FROM $wpdb->terms WHERE term_id=" . $category_id);

	if(isset($photo2) && $photo2 != "") {
		echo "<div class='full-wide'><img src='$photo2' alt=''>";
		if(isset($photo1) && $photo1 != "") {
			echo "<div class='avatar'><img src='$photo1' alt=''></div>";
		}
		echo '</div>';
	}
?>

<div class="menu_custom"><br>
<div class="content"><ul class="cus"><li><a href="#">Video</a></li><li><a href="#">Blog</li><li><a href="#">News</a></li><li><a href="#">Contact</li></a></ul>
</div>
</div>

    <div id="left-div"> 




        <!--Begind recent post-->
		
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="home-post-wrap">
            <div class="home-post-wrap-top">
                <div class="comment-buble">
                    <?php comments_popup_link('0', '1', '%'); ?>
                </div>
                <div class="date">
                    <?php the_time('m jS, Y') ?>
                </div>
            </div>
            <div class="thumbnail-div">
                
				<?php $width = 189;
					  $height = 175;
							  
					  $classtext = 'linkimage';
					  $titletext = get_the_title();

					  $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
					  $thumb = $thumbnail["thumb"]; ?>

                <?php // if there's a thumbnail
					if($thumb != '') { ?>
						<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
                <?php }; ?>
				
                <div class="overlay"> </div>
                <div class="post-info2">
                    <h2 class="post-info-title"><a href="<?php the_permalink() ?>" title="<?php printf(esc_attr__('Permanent Link to %s','eVid'), get_the_title()) ?>">
                        <?php truncate_title(30) ?>
                        </a></h2>
                    <div style="clear: both;"></div>
                    <?php get_template_part('includes/postinfo'); ?>
                </div>
            </div>
            <img src="<?php bloginfo('template_directory'); ?>/images/post-bottom-<?php echo esc_attr(get_option('evid_color_scheme')); ?>.gif" style="margin: 0px 0px 0px 0px; float: left;" alt="post bottom" /> </div>
        <?php endwhile; ?>
        <!--end recent post-->
        <div style="clear: both;"></div>
        <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } 
else { ?>
        <p class="pagination">
            <?php next_posts_link(esc_html__('&laquo; Previous Entries','eVid')) ?>
	        <?php previous_posts_link(esc_html__('Next Entries &raquo;','eVid')) ?>
        </p>
        <?php } ?>
        <?php else : ?>
        <!--If no results are found-->
        <h1><?php esc_html_e('No Results Found','eVid') ?></h1>
<p><?php esc_html_e('The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.','eVid') ?></p>
        <!--End if no results are found-->
        <?php endif; ?>
    </div>
    <?php //get_sidebar(); ?>
    <?php get_footer(); ?>
</div>
</body>
</html>       